<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<!-- bootstrap table js -->
<script src="../bootstrapTable/dist/bootstrap-table.js"></script>
<script src="../bootstrapTable/dist/locale/bootstrap-table-zh-CN.js"></script>

<script src="ship.js"></script>
<script src="common.js"></script>

<script type="text/javascript">
$(function(){
	$('#berthcode').change(function(){
		var berth = $(this).find("option:selected").text();
		$('#berth').val(berth);
	})
	
	$('#worktype').change(function(){
		var worktypename = "";
		
		var worktypedata = $(this).select2("data");
		for(var i = 0; i < worktypedata.length; i++){
			worktypename += worktypedata[i].text + ',';			
		}
		worktypename = worktypename.substring(0, worktypename.length - 1); 
		
		$('#worktypename').val(worktypename);
	})
	
    $('#worktype').select2({  
        placeholder: "请选择作业种类",  
        width:'100%'  
    });  
    
    bindDict1('worktype', 'DM_BBZYZL', null);

    $('#otherberth').hide();
    $('#other').change(function(){
	    $('#berthcode').val('');
	    $('#berth').val('');
	    
    	if($(this).is(':checked')){
    	    $('#otherberth').show();
    	    $('#otherberth').trigger('change');
   	    }
    	else{
    	    $('#otherberth').hide();
    	}
    });
    $('#otherberth').change(function(){
    	$('#berth').val($(this).val());
    });
    
    $(".hiddenField").hide();
})

</script>
</head>
<body>

		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">申请单信息</h3>
			</div>

			<div class="panel-body">
				<form id="Business">
					<table class="table table-bordered">
					<tbody>
						<tr>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								报送机构：<span style="color:red;">*</span>
							</td>
							<td colspan="5">
    							<input style="width: 200px;" type="text" class="form-control" id="org" placeholder="请选择报送机构">
							</td>
						</tr>
						<tr>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								船舶名称：
							</td>
							<td>
								<div class="input-group">
									<input type="text" class="form-control" disabled="disabled" id="ship" placeholder="选择船舶名称">
									<span class="input-group-btn">
										<button class="btn btn-primary" type="button" id="selectShip">
											选择船舶
										</button>
									</span>
								</div>
							</td>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								作业项目：<span style="color:red;">*</span>
							</td>
							<td colspan="3">
				                <select class="combox" id="worktype" name="worktype" multiple>    
				                </select>
				                <input type="hidden" name="worktypename" id="worktypename" placeholder="请选择作业项目">
							</td>
							<td style="width:130px; text-align: right; background-color: #eee; " class="hiddenField">
								货物装载情况：
							</td>
							<td colspan="3" class="hiddenField">
    							<input type="text" class="form-control" name="cargoloading" placeholder="请输入货物装载情况">
							</td>
						</tr>
						<tr class="hiddenField">
							<td style="width:130px; text-align: right; background-color: #eee; ">
								报备人：<span style="color:red;">*</span>
							</td>
							<td>
    							<input type="text" class="form-control" name="reportperson" placeholder="请输入报备人">
							</td>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								报备人联系电话：<span style="color:red;">*</span>
							</td>
							<td colspan="3">
    							<input type="text" class="form-control" name="reportphone" placeholder="请输入报备人联系电话">
							</td>
						</tr>
						<tr>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								作业地点：<span style="color:red;">*</span>
							</td>
							<td colspan="5">
							
								<div class="row">
									<div class="col-lg-3">
		    							<select class="form-control" name="berthcode" id="berthcode" placeholder="请选择作业地点"></select>
		    							<input type="hidden" name="berth" id="berth">
	    							</div>
									<div class="col-lg-1">
										<input type="checkbox" id="other">其它
									</div>
									<div class="col-lg-3">
    									<input type="text" class="form-control" id="otherberth" placeholder="请输入作业地点">
									</div>
								</div>
    							
							</td>
						</tr>
						<tr>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								作业开始时间：<span style="color:red;">*</span>
							</td>
							<td>
    							<input type="date" class="form-control" name="workstarttime" placeholder="请输入作业开始时间">
							</td>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								作业结束时间：<span style="color:red;">*</span>
							</td>
							<td colspan="3">
    							<input type="date" class="form-control" name="workendtime" placeholder="请输入作业结束时间">
							</td>
						</tr>
						<tr>
							<!-- <td style="width:130px; text-align: right; background-color: #eee; ">
								作业单位：
							</td>
							<td>
    							<input type="text" class="form-control" name="workunitname" placeholder="请输入作业单位">
							</td> -->
							<td style="width:130px; text-align: right; background-color: #eee; ">
								联系人：
							</td>
							<td>
    							<input type="text" class="form-control" name="contactperson" readonly="readonly">
							</td>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								联系电话：
							</td>
							<td>
    							<input type="text" class="form-control" name="contactphone" readonly="readonly">
							</td>
						</tr>
						<tr class="hiddenField">
							<td style="width:130px; text-align: right; background-color: #eee; ">
								作业部位及项目：<span style="color:red;">*</span>
							</td>
							<td colspan="5">
    							<input type="text" class="form-control" name="workcontent" placeholder="请输入作业部位及项目">
							</td>
						</tr>
						<tr class="hiddenField">
							<td style="width:130px; text-align: right; background-color: #eee; ">
								资质证明：
							</td>
							<td colspan="5">
    							<input type="text" class="form-control" name="workperson" placeholder="请输入资质证明">
							</td>
						</tr>
						<tr class="hiddenField">
							<td style="width:130px; text-align: right; background-color: #eee; ">
								船长安全声明：
							</td>
							<td colspan="5">
    							<input type="text" class="form-control" name="securitystatement" placeholder="请输入船长安全声明">
							</td>
						</tr>
						<tr class="hiddenField">
							<td style="width:130px; text-align: right; background-color: #eee; ">
								安全措施：
							</td>
							<td colspan="5">
    							<input type="text" class="form-control" name="safetymeasure" placeholder="请输入安全措施">
							</td>
						</tr>
						<tr class="hiddenField">
							<td style="width:130px; text-align: right; background-color: #eee; ">
								整改意见：
							</td>
							<td colspan="5">
    							<input type="text" class="form-control" name="correctionopinions" placeholder="请输入整改意见">
							</td>
						</tr>
						<tr>
							<td style="width:130px; text-align: right; background-color: #eee; ">
								其他说明事项：
							</td>
							<td colspan="5">
    							<input type="text" class="form-control" name="remark" placeholder="请输入其他说明事项">
							</td>
						</tr>
					</tbody>
					</table>
					
	            </form>
			</div>
		</div>
	
	<div class="modal fade" id="modalCheck" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content" style="width: 800px; height: 600px; overflow:auto;">
			  <div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">校验信息</h4>
				</div>
				
				<div class="modal-body" id="checkinfo">
					<table class="table" id="certShip">
						<caption>法定证书校验</caption>
						<thead>
							<tr>
								<th style="text-align: center;width:35%">校验内容</th>
								<th style="text-align: center;width:10%">校验结果</th>
								<th style="text-align: center;width:55%">结果详情</th>
							</tr>
						</thead>
						</tbody>
					</table>
					
					<table class="table" id="fsc">
						<caption>船舶安检信息校验</caption>
						<thead>
							<tr>
								<th style="text-align: center;width:35%">校验内容</th>
								<th style="text-align: center;width:10%">校验结果</th>
								<th style="text-align: center;width:55%">结果详情</th>
							</tr>
						</thead>
						</tbody>
					</table>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
</body>
</html>